package com.reason.user.controller;



import com.reason.common.pojo.Result;
import com.reason.common.pojo.StatusCode;
import com.reason.user.pojo.Economics;
import com.reason.user.pojo.Job;
import com.reason.user.service.JobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @author  yulongjun
 * @date 2020/6/29 10:42 下午
 */
@RestController
@RequestMapping("/job")
public class JobController {
    @Autowired
    private JobService jobService;
    /**
     * 查询所有
     * @return
     */
    @RequestMapping("/findAll")
    public Result<List<Job>> findAll() {

        List <Job> brandList = jobService.findBrandList();
        System.out.println(brandList);
        return new Result<List<Job>>  (true, StatusCode.OK, "查询成功", brandList);
    }

    /**
     * 根据ID查询Job
     * @return
     */
    @GetMapping("/findById/{Id}")
    public Job findById(@PathVariable("Id") Long Id){
        Job job=jobService.findByID(Id);
        if(job==null){
            return null;
        }
    return job;
    }
}
